<div class="list-group">
    {% for category in categories %}
        <div class="list-group-item">
            <a href="{{ category.href }}">
                <img src="{{ category.image }}" alt="{{ category.name }}" title="{{ category.name }}"/>
                <span>{{ category.name }}</span>
            </a>
        </div>
        {#{% if category.category_id == category_id %} #}
        {#<a href="{{ category.href }}" class="list-group-item active">{{ category.name }}</a> #}
        {#{% if category.children %}#}
        {#{% for child in category.children %}#}
        {#{% if child.category_id == child_id %}#}
        {#<a href="{{ child.href }}" class="list-group-item active">&nbsp;&nbsp;&nbsp;- {{ child.name }}</a> #}
        {#{% else %} #}
        {#<a href="{{ child.href }}" class="list-group-item">&nbsp;&nbsp;&nbsp;- {{ child.name }}</a>#}
        {#{% endif %}#}
        {#{% endfor %}#}
        {#{% endif %}#}
        {#{% else %} #}
        {#<div class="image"><a href="{{ category.href }}"><img src="{{ category.image }}" alt="{{ category.name }}" title="{{ category.name }}"/></a></div>#}
        {#<a href="{{ category.href }}" class="list-group-item">{{ category.name }}</a>#}
        {#{% endif %}#}
    {% endfor %}
</div>
